/* 
** Page de base dont toute les autres pages doivent deriver
** 
*/

using System;
using System.IO;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Globalization;
using System.Threading;

public class PageBase : System.Web.UI.Page
{
    protected override void InitializeCulture()
    {
        // Make sure to call base class implementation
        base.InitializeCulture();

        // Pull language preference from profile
        string LanguagePreference = "";
        LanguagePreference = Context.Profile[ "LanguagePreference" ].ToString();

        // Check to see if user has requested specific culture
        if ( ( LanguagePreference != null ) && ( LanguagePreference.CompareTo( "Auto" ) != 0 ) )
        {
            // Assign culture UI
            this.UICulture = LanguagePreference;
            // Assign culture with region
            Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture( LanguagePreference );
        }

    }
}
